{% extends 'dish_type/dish_type_base.html' %}

{% block title %}
    菜品管理
{% endblock %}

{#{% block aside %}#}
{#        <ul class="nav nav-pills nav-stacked">#}
{#        <li role="presentation" class="active"><a href="#">菜品管理首页</a></li>#}
{#        <li role="presentation"><a href="#">新增菜品</a></li>#}
{#        <li role="presentation"><a href="#">修改菜品</a></li>#}
{#        <li role="presentation"><a href="#">删除菜品</a> </li>#}
{#    </ul>#}
{#{% endblock %}#}

{% block content %}
 <div>
         <ol class="breadcrumb">
          <li><a href="#">首页</a></li>
          <li><a href="#">菜品管理</a></li>
          <li class="active">菜品管理首页</li>
        </ol>
   <table class="table">
        <tr>
            <td>序号</td>
            <td>菜品名</td>
            <td>创建日期</td>
            <td>操作</td>
        </tr>
        {% for dish_type in dish_types %}
            <tr>
                <td>{{ loop.index }}</td>
                <td>{{ dish_type.dish_type_name }}</td>
                <td>{{ dish_type.on_time }}</td>
            {% if dish_type.is_delete == 0 %}
                <td>
                    <form action="{{ url_for("dish_type.delete_dish_type") }}" method="get">
                        <input type="hidden" name="dish_type_no" value="{{ dish_type.dish_type_no }}">
                        <button type="submit" class="btn btn-danger">下线</button>
                    </form>
                </td>
            {% else %}
                <td>
                    <form action="{{ url_for("dish_type.wakeup") }}" method="get">
                        <input type="hidden" name="dish_type_no" value="{{ dish_type.dish_type_no }}">
                        <button type="submit" class="btn btn-success">上线</button>
                    </form>
                </td>
            {% endif %}
            </tr>
        {% endfor %}
   </table>
 </div>
{% endblock %}